package cn.tedu.dictionary.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class PubSubQueueService {
    @Autowired
    private RedisTemplate redisTemplate;
    /**向指定频道(Channel)发送消息*/
    public void publish(String channel, Object message) {
        redisTemplate.convertAndSend(channel, message);
    }
}
